<?php


namespace app\api\validate;


use think\Validate;

class SystemRole extends Validate
{
    /**
     * @var string[] 验证规则
     */
    protected $rule = [
        'name' => 'require',
        'sort' => 'number',
        'id' => 'require'
    ];

    /**
     * @var string[] 验证不同过的错误提示
     */
    protected $message = [
        'name.require' => '名称不能为空!',
        'sort.number' => '排序字段必须为数字!',
        'id.require' => '角色id不能为空!'
    ];

    /**
     * @var \string[][] 验证场景
     */
    protected $scene = [
        'add' => ['name', 'sort'],
        'detail' => ['id'],
        'edit' => ['id', 'name', 'sort'],
        'del' => ['id']
    ];
}